<?php 

class ressource {
	//int
	private $amount = 0;
	//string
	private $name;
	//int
	private $price = 0;
	
	private static $sellingDiff = 0;
    private static $buyingDiff = 0;
	 

    public static function setSellingDiff($val) {
        self::$sellingDiff = $val;
    }
    
    
    public static function setBuyingDiff($val) {
        self::$buyingDiff = $val;
    }
	
	public function getValueBuying() {
		if($this->name == "Gold") {
			return $this->price * $this->amount;			
		}
		
		return ($this->price - self::$buyingDiff) * $this->amount;		
	}
	
	public function getValueSelling() {
		if($this->name == "Gold") {
			return $this->price * $this->amount;			
		}
		
		return ($this->price + self::$sellingDiff) * $this->amount;
	}
	
	/**
	 * @return unknown
	 */
	public function getAmount() {
		return $this->amount;
	}
	
	/**
	 * @return unknown
	 */
	public function getName() {
		return $this->name;
	}
	
	/**
	 * @return unknown
	 */
	public function getPrice() {
		return $this->price;
	}
	
	/**
	 * @param unknown_type $amount
	 */
	public function setAmount($amount) {
		$this->amount = $amount;
	}
	
	/**
	 * @param unknown_type $name
	 */
	public function setName($name) {
		$this->name = $name;
	}
	
	/**
	 * @param unknown_type $price
	 */
	public function setPrice($price) {
		$this->price = $price;
	}

}

?>